package 深入反射机制.路径问题.test01;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class AboutPath {
    public static void main(String[] args) {
        FileInputStream fis = null;
        try {
            fis = new FileInputStream("D:\\Desktop\\IDEA\\反射机制\\src\\通过反射实例化对象\\test02\\classinfo.properties");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }finally {
            try {
                fis.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        //通用路径写法
        String path = Thread.currentThread().getContextClassLoader().getResource("深入反射机制/路径问题/test01/classinfo2.properties").getPath();
        System.out.println(path);
    }
}
